<template>
  <div>
    <el-button type="primary" @click="willAdd">添加</el-button>
    <v-list @edit="willEdit"></v-list>
    <v-form :info="info" ref="form"></v-form>
  </div>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
import vForm from "./component/form";
import vList from "./component/list";
export default {
  props: [],
  components: {
    vForm,
    vList,
  },
  data() {
    return {
      info: {
        isshow: false,
        isAdd: true,
      },
    };
  },
  computed: {
    ...mapGetters({}),
  },
  mounted() {},
  methods: {
    ...mapActions({}),
    willAdd(){
      this.info.isshow=true
      this.info.isAdd=true
    },
    willEdit(id){
      this.info.isshow=true
      this.info.isAdd=false
      this.$refs.form.getOne(id)
    },
  },
};
</script>
<style scoped lang="less">
@import "../../less/index.less";
</style>